package com.jzo2o.customer.controller.operation;

import cn.hutool.core.bean.BeanUtil;
import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.response.WorkerCertificationAuditPageQueryResDTO;
import com.jzo2o.customer.model.dto.response.WorkerCertificationResDTO;
import com.jzo2o.customer.service.IWorkerCertificationService;
import com.jzo2o.customer.service.WorkerCertificationAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author itcast
 */
@RestController("workerCertificationAuditController")
@RequestMapping("/operation/worker-certification-audit")
@Api(tags = "运营端 - 运营端审核认证接服务人员相关接口")
public class WorkerCertificationAuditController {

    @Autowired
    private WorkerCertificationAuditService workerCertificationAuditService;


    /**
     *  审核服务人员认证分页查询
     * @param dto
     * @return
     */
    @GetMapping("/page")
    @ApiOperation("审核服务人员认证分页查询")
    public WorkerCertificationAuditPageQueryResDTO getPage(WorkerCertificationAuditPageQueryReqDTO dto){
        return workerCertificationAuditService.getPage(dto);
    }

    /**
     * 审核服务人员认证信息
     * @param id
     * @param certificationStatus
     * @param rejectReason
     */
    @PutMapping("/audit/{id}")
    @ApiOperation("审核服务人员认证信息")
    public void audit(@PathVariable("id") Long id,Integer certificationStatus,String rejectReason){
        workerCertificationAuditService.audit(id,certificationStatus,rejectReason);
    }
}
